//
// Created by GF on 2023/10/27.
//

#include <stdio.h>  /* printf() */
#include <stdlib.h>  /* atoi(); atof(); strtod(); */
#include <string.h> /* memset(); memcpy(); */
#include <malloc.h> /* malloc() */
#include "Record_NodeList.h"
#include "Array_Function.h"

/* Field NodeList 节点(Node)初始化 */
struct Field_Node* Field_NodeList_Node_Init() {

    struct Field_Node* Field_Head = (struct Field_Node*)malloc(sizeof(struct Field_Node)); /* 创建一个数据记录链表的表头表示整个数据记录链表 */
    /* ********************************************** */
    memset(Field_Head, 0, sizeof(*Field_Head));
    /* ********************************************** */
    Field_Head->Prev = NULL; /* 将 Field NodeList 的 Prev 设置为 NULL */
    Field_Head->Next = NULL; /* 将 Field NodeList 的 Next 设置为 NULL */
    /* ********************************************** */
    return Field_Head;
}

/* Record NodeList 节点(Node)初始化 */
struct Record_Node* Record_NodeList_Node_Init() {

    struct Record_Node* Record_Head = (struct Record_Node*)malloc(sizeof(struct Record_Node)); /* 创建一个数据记录链表的表头表示整个数据记录链表 */
    /* ********************************************** */
    memset(Record_Head, 0, sizeof(*Record_Head)); /* memset 函数按字节对内存块进行初始化 */
    /* ********************************************** */
    Record_Head->Prev = NULL; /* 将 Record NodeList 的 Prev 设置为 NULL */
    Record_Head->Next = NULL; /* 将 Record NodeList 的 Next 设置为 NULL */
    /* ********************************************** */
    Record_Head->Field = Field_NodeList_Node_Init(); /* 初始化 Record.Field 的头节点 */
    /* ********************************************** */
    return Record_Head;
}

/* Field NodeList 获取字段(Field)最大索引 */
int Field_NodeList_Get_Max_Index(struct Field_Node* Field_Head) {

    int Max_Field_Idx = -1;
    /* ********************************************** */
    if (Field_Head->Next == NULL) {
        return Max_Field_Idx;
    } else {
        struct Field_Node* Mov_Node = Field_Head;
        /* ****************************************** */
        while (Mov_Node->Next != NULL) {
            Mov_Node = Mov_Node->Next;
            if (Mov_Node->Idx > Max_Field_Idx) Max_Field_Idx = Mov_Node->Idx;
        }
    }
    /* ********************************************** */
    return Max_Field_Idx;
}

/* Field NodeList 判断字段(Field)存在某个索引(Index) */
int Field_NodeList_Judge_Exists_Idx(struct Field_Node* Field_Head, int FldIdx) {

    int True_Or_False = 0;
    /* ********************************************** */
    struct Field_Node* Mov_Field = Field_Head;
    /* ********************************************** */
    while (Mov_Field->Next != NULL) {
        Mov_Field = Mov_Field->Next;
        /* ****************************************** */
        if (Mov_Field->Idx == FldIdx) {True_Or_False = 1; break;}
    }
    /* ********************************************** */
    return True_Or_False;
}

/* Field NodeList 判断字段(Field)存在某个字段名 */
int Field_NodeList_Judge_Exists_FldName(struct Field_Node* Field_Head, char* Field_Name) {

    int True_Or_False = 0;
    /* ********************************************** */
    struct Field_Node* Mov_Field = Field_Head;
    /* ********************************************** */
    while (Mov_Field->Next != NULL) {
        Mov_Field = Mov_Field->Next;
        /* ****************************************** */
        if (strcmp(Mov_Field->Name, Field_Name) == 0) {True_Or_False = 1; break;}
    }
    /* ********************************************** */
    return True_Or_False;
}

/* Field NodeList 字段末尾添加字段(Field) */
void Field_NodeList_Append_Field(struct Field_Node* Field_Head, char* Field_Name) {

    struct Field_Node* New_Field = (struct Field_Node*)malloc(sizeof(struct Field_Node));
    /* ********************************************** */
    memset(New_Field, 0, sizeof(*New_Field));
    /* ********************************************** */
    /* Calling Other Function: Field NodeList 获取字段(Field)最大索引 */
    int New_Field_Idx = Field_NodeList_Get_Max_Index(Field_Head) + 1;
    /* ********************************************** */
    New_Field->Idx = New_Field_Idx;
    if (Field_Name != NULL) strcpy(New_Field->Name, Field_Name);
    New_Field->Next = NULL;
    /* ********************************************** */
    if (Field_Head->Next == NULL) {
        Field_Head->Next = New_Field;
        /* ****************************************** */
        New_Field->Prev = Field_Head;
    } else {
        struct Field_Node* Mov_Node = Field_Head;
        /* ****************************************** */
        while (Mov_Node->Next != NULL) Mov_Node = Mov_Node->Next;
        /* ****************************************** */
        Mov_Node->Next = New_Field;
        /* ****************************************** */
        New_Field->Prev = Mov_Node;
    }
}

/* Field NodeList 字段末尾添加字段(Field) - 指定索引(Index) */
void Field_NodeList_Append_Field_Alloc_Idx(struct Field_Node* Field_Head, char* FldName, int FldIdx) {

    struct Field_Node* New_Field = (struct Field_Node*)malloc(sizeof(struct Field_Node));
    /* ********************************************** */
    memset(New_Field, 0, sizeof(*New_Field));
    /* ********************************************** */
    New_Field->Idx = FldIdx;
    if (FldName != NULL) strcpy(New_Field->Name, FldName);
    New_Field->Next = NULL;
    /* ********************************************** */
    if (Field_Head->Next == NULL) {
        Field_Head->Next = New_Field;
        /* ****************************************** */
        New_Field->Prev = Field_Head;
    } else {
        struct Field_Node* Mov_Node = Field_Head;
        /* ****************************************** */
        while (Mov_Node->Next != NULL) Mov_Node = Mov_Node->Next;
        /* ****************************************** */
        Mov_Node->Next = New_Field;
        /* ****************************************** */
        New_Field->Prev = Mov_Node;
    }
}

/* Field NodeList 复制字段(Field)值 - 通过字段名复制 */
void Field_NodeList_Copy_FldVals_By_FldName(struct Field_Node* Dst_Head, char* Dst_FldName, struct Field_Node* Src_Head, char* Src_FldName) {

    if (Dst_Head->Next == NULL) {
        printf("Field NodeList Notice : The Destination Field Value is Empty, Copy Field Values Failed.\n");
    } else if (Src_Head->Next == NULL) {
        printf("Field NodeList Notice : The Source Field Value is Empty, Copy Field Values Failed.\n");
    } else {
        struct Field_Node* Mov_Dst = Dst_Head;
        /* ****************************************** */
        while (Mov_Dst->Next != NULL) {
            Mov_Dst = Mov_Dst->Next;
            /* ************************************** */
            if (strcmp(Mov_Dst->Name, Dst_FldName) == 0) break;
        }
        /* ****************************************** */
        if (Mov_Dst != NULL) {
            struct Field_Node* Mov_Src = Src_Head;
            /* ************************************** */
            while (Mov_Src->Next != NULL) {
                Mov_Src = Mov_Src->Next;
                /* ********************************** */
                if (strcmp(Mov_Src->Name, Src_FldName) == 0) break;
            }
            /* ************************************** */
            strcpy(Mov_Dst->Type, Mov_Src->Type);
            strcpy(Mov_Dst->StrVal, Mov_Src->StrVal);
            Mov_Dst->IntVal = Mov_Src->IntVal;
            Mov_Dst->DecVal = Mov_Src->DecVal;
        }
    }
}

/* Field NodeList 查找字段String值 - 通过字段名查找 */
char* Field_NodeList_Find_StrVal_By_FldName(struct Field_Node* Field_Head, char* Field_Name) {

    if (Field_Head->Next == NULL) {
        printf("Field NodeList Notice : Field NodeList Doesn't Have Any Field Yet, Find Field Value Failed.\n");
        /* ****************************************** */
        return NULL;
    } else {
        struct Field_Node* Mov_Node = Field_Head;
        /* ****************************************** */
        while (Mov_Node->Next != NULL) {
            Mov_Node = Mov_Node->Next;
            /* ************************************** */
            if (strcmp(Mov_Node->Name, Field_Name) == 0) break;
        }
        /* ****************************************** */
        if (Mov_Node == NULL) {
            return NULL;
        } else {
            char* Found_StrVal = (char*)malloc(sizeof(char) * 32);
            /* ************************************** */
            strcpy(Found_StrVal, Mov_Node->StrVal);
            /* ************************************** */
            return Found_StrVal;
        }
    }
}

/* Field NodeList 查找字段Decimal值 - 通过字段名查找 */
double Field_NodeList_Find_DecVal_By_FldName(struct Field_Node* Field_Head, char* Field_Name) {

    if (Field_Head->Next == NULL) {
        printf("Field NodeList Notice : Field NodeList Doesn't Have Any Field Yet, Find Field Value Failed.\n");
        /* ****************************************** */
        return 0.0;
    } else {
        double Res_Field_DecVal = 0.0;
        /* ****************************************** */
        struct Field_Node* Mov_Node = Field_Head;
        /* ****************************************** */
        while (Mov_Node->Next != NULL) {
            Mov_Node = Mov_Node->Next;
            /* ************************************** */
            if (strcmp(Mov_Node->Name, Field_Name) == 0) break;
        }
        /* ****************************************** */
        if (Mov_Node != NULL) Res_Field_DecVal = Mov_Node->DecVal;
        /* ****************************************** */
        return Res_Field_DecVal;
    }
}

/* Field NodeList 字段(Field)名称格式化输出 */
void Field_NodeList_FldName_Format_Print(struct Field_Node* Field_Head) {

    /* 条件判断 : 如果字段链表字段指向的 Next 节点为 NULL */
    if (Field_Head->Next == NULL) {
        printf("Field NodeList Notice : Field NodeList Doesn't Have Any Field Yet, Field Name Format Print Failed.\n");
    } else {
        struct Field_Node* Mov_Node = Field_Head;
        while (Mov_Node->Next != NULL) {
            Mov_Node = Mov_Node->Next;
            /* ************************************** */
            /*
            * printf(); sprintf(); 补0 / 补空格占位:
            *
            * printf("%10d\n",12345); //右对齐, 位数不够, 左边自动补空格.
            * printf("%-10d,%c\n", 12345, 'A'); //左对齐, 位数不够, 右边自动补空格.
            * printf("%010d\n",12345); //右对齐, 位数不够, 左边自动补0.
            */
            if (Mov_Node != NULL) printf("%15s|", Mov_Node->Name);
        }
        printf("\n");
    }
}

/* Field NodeList 字段(Field)名称格式化输出为CSV */
void Field_NodeList_FldName_Format_Print_As_Csv(struct Field_Node* Field_Head, char* Out_Path) {

    if (Field_Head->Next == NULL) {
        printf("Field NodeList Notice : Field NodeList Doesn't Have Any Field Yet, Field Name Format Print Failed.\n");
    } else {
        FILE* fp;
        /* ****************************************** */
        fp = fopen(Out_Path, "w");
        /* ****************************************** */
        struct Field_Node* Mov_Node = Field_Head;
        while (Mov_Node->Next != NULL) {
            Mov_Node = Mov_Node->Next;
            /* ************************************** */
            if (Mov_Node != NULL) fprintf(fp, "%15s|", Mov_Node->Name);

        }
        fprintf(fp, "\n");
        fclose(fp);
    }
}

/* Field NodeList 字段(Field)值格式化输出 */
void Field_NodeList_FldVal_Format_Print(struct Field_Node* Field_Head) {

    /* 条件判断 : 如果字段链表字段指向的 Next 节点为 NULL */
    if (Field_Head->Next == NULL) {
        printf("Field NodeList Notice : Field NodeList Doesn't Have Any Field Yet, Field Value Format Print Failed.\n");
    } else {
        struct Field_Node* Mov_Node = Field_Head;
        while (Mov_Node->Next != NULL) {
            Mov_Node = Mov_Node->Next;
            /* ************************************** */
            if (Mov_Node != NULL) {
                if (strcmp(Mov_Node->Type, "String") == 0) printf("%15s|", Mov_Node->StrVal);
                if (strcmp(Mov_Node->Type, "Integer") == 0) printf("%15d|", Mov_Node->IntVal);
                if (strcmp(Mov_Node->Type, "Decimal") == 0) printf("%15.4f|", Mov_Node->DecVal);
            }
        }
        printf("\n");
    }
}

/* Field NodeList 字段(Field)值格式化输出为CSV */
void Field_NodeList_FldVal_Format_Print_As_Csv(struct Field_Node* Field_Head, char* Out_Path) {

    if (Field_Head->Next == NULL) {
        printf("Field NodeList Notice : Field NodeList Doesn't Have Any Field Yet, Field Name Format Print Failed.\n");
    } else {
        FILE* fp;
        /* ****************************************** */
        fp = fopen(Out_Path, "a");
        /* ****************************************** */
        struct Field_Node* Mov_Node = Field_Head;
        while (Mov_Node->Next != NULL) {
            Mov_Node = Mov_Node->Next;
            /* ************************************** */
            if (Mov_Node != NULL) {
                if (strcmp(Mov_Node->Type, "String") == 0) fprintf(fp, "%15s|", Mov_Node->StrVal);
                if (strcmp(Mov_Node->Type, "Integer") == 0) fprintf(fp, "%15d|", Mov_Node->IntVal);
                if (strcmp(Mov_Node->Type, "Decimal") == 0) fprintf(fp, "%15.4f|", Mov_Node->DecVal);
            }

        }
        fprintf(fp, "\n");
        fclose(fp);
    }
}

/* Record NodeList 获取记录(Record)最大索引 */
int Record_NodeList_Get_Max_Index(struct Record_Node* Record_Head) {

    int Max_Record_Idx = 0;
    /* ********************************************** */
    if (Record_Head->Next == NULL) {
        return -1;
    } else if (Record_Head->Next != NULL) {
        struct Record_Node* Temp_Node = Record_Head;
        /* ****************************************** */
        while (Temp_Node->Next != NULL) {
            Temp_Node = Temp_Node->Next;
            if (Temp_Node->Idx > Max_Record_Idx) Max_Record_Idx = Temp_Node->Idx;
        }
    }
    /* ********************************************** */
    return Max_Record_Idx;
}

/* Record NodeList 获取记录(Record)行数 */
int Record_NodeList_Get_Rows_Number(struct Record_Node* Record_Head) {

    int Counter = 0;
    /* ********************************************** */
    if (Record_Head->Next == NULL) {
        return Counter;
    } else if (Record_Head->Next != NULL) {
        struct Record_Node* Mov_Record = Record_Head;
        /* ****************************************** */
        while (Mov_Record->Next != NULL) {
            Mov_Record = Mov_Record->Next;
            Counter += 1;
        }
    }
    /* ********************************************** */
    return Counter;
}

/* Record NodeList 获取字段(Field)索引(Index) - 通过字段名获取 */
int Record_NodeList_Get_FldIdx_By_FldName(struct Record_Node* Record_Head, char* Field_Name) {

    /* 如果字段名称只存在于记录(Record)链表的头节点, 那么查找字段(Field)索引, 需要以记录(Record)链表的头节点为入口 */
    int Field_Index = -1;
    /* ********************************************** */
    if (Record_Head->Field->Next == NULL) {
        printf("Record NodeList Notice : Field NodeList Doesn't Have Any Field Yet, Get Field Index Failed.\n");
        /* ****************************************** */
        return Field_Index;
    } else {
        struct Field_Node* Mov_Node = Record_Head->Field;
        /* ****************************************** */
        while (Mov_Node->Next != NULL) {
            Mov_Node = Mov_Node->Next;
            /* ************************************** */
            if (strcmp(Mov_Node->Name, Field_Name) == 0) break;
        }
        /* ****************************************** */
        if (Mov_Node != NULL) Field_Index = Mov_Node->Idx;
        /* ****************************************** */
        return Field_Index;
    }
}

/* Record NodeList 判断记录(Record)存在某个索引(Index) */
int Record_NodeList_Judge_Exists_Idx(struct Record_Node* Record_Head, int RecIdx) {

    int True_Or_False = 0;
    /* ********************************************** */
    struct Record_Node* Mov_Record = Record_Head;
    /* ********************************************** */
    while (Mov_Record->Next != NULL) {
        Mov_Record = Mov_Record->Next;
        /* ****************************************** */
        if (Mov_Record->Idx == RecIdx) {True_Or_False = 1; break;}
    }
    /* ********************************************** */
    return True_Or_False;
}

/* Record NodeList 刷新字段(Field)到所有记录 */
void Record_NodeList_Flush_Field_To_All_Rec(struct Record_Node* Record_Head) {

    int Skip = 0;
    /* ********************************************** */
    struct Record_Node* Mov_Record = Record_Head;
    while (Mov_Record->Next != NULL) {
        Mov_Record = Mov_Record->Next;
        /* ****************************************** */
        struct Field_Node* Refer_Field = Record_Head->Field;
        while (Refer_Field->Next != NULL) {
            Refer_Field = Refer_Field->Next;
            /* ************************************** */
            if (Refer_Field == NULL) break;
            /* ************************************** */
            /* Calling Other Function: Field NodeList 判断字段(Field)存在某个索引(Index) */
            if (Field_NodeList_Judge_Exists_Idx(Mov_Record->Field, Refer_Field->Idx) == 0)
                /* Calling Other Function: Field NodeList 字段末尾添加字段(Field) - 指定索引(Index) */
                //Field_NodeList_Append_Field_Alloc_Idx(Mov_Record->Field, NULL, Refer_Field->Idx); /* 不分配字段名称, 只分配字段索引 */
                Field_NodeList_Append_Field_Alloc_Idx(Mov_Record->Field, Refer_Field->Name, Refer_Field->Idx); /* 分配字段名称, 并分配字段索引 */
            else Skip += 1;
        }
    }
}

/* Record NodeList 记录末尾添加记录(Record) */
void Record_NodeList_Append_Record(struct Record_Node* Record_Head) {

    struct Record_Node* New_Record = Record_NodeList_Node_Init();
    /* ********************************************** */
    /* Calling Other Function: Record NodeList 获取记录(Record)最大索引 */
    int New_Record_Idx = Record_NodeList_Get_Max_Index(Record_Head) + 1;
    /* ********************************************** */
    New_Record->Idx = New_Record_Idx;
    New_Record->Next = NULL;
    /* ********************************************** */
    if (Record_Head->Next == NULL) {
        Record_Head->Next = New_Record;
        /* ****************************************** */
        New_Record->Prev = Record_Head;
    } else {
        struct Record_Node* Src_Record = Record_Head;
        while (Src_Record->Next != NULL) Src_Record = Src_Record->Next;
        /* ****************************************** */
        Src_Record->Next = New_Record;
        /* ****************************************** */
        New_Record->Prev = Src_Record;
    }
    /* Calling Other Function: Record NodeList 刷新字段(Field)到所有记录 */
    Record_NodeList_Flush_Field_To_All_Rec(Record_Head);
}

/* Record NodeList 记录末尾添加记录(Record) - 指定索引(Index) */
void Record_NodeList_Append_Record_Alloc_Idx(struct Record_Node* Record_Head, int RecIdx) {

    struct Record_Node* New_Record = Record_NodeList_Node_Init();
    /* ********************************************** */
    New_Record->Idx = RecIdx;
    New_Record->Next = NULL;
    /* ********************************************** */
    if (Record_Head->Next == NULL) {
        Record_Head->Next = New_Record;
        /* ****************************************** */
        New_Record->Prev = Record_Head;
    } else {
        struct Record_Node* Src_Record = Record_Head;
        while (Src_Record->Next != NULL) Src_Record = Src_Record->Next;
        /* ****************************************** */
        Src_Record->Next = New_Record;
        /* ****************************************** */
        New_Record->Prev = Src_Record;
    }
    /* Calling Other Function: Record NodeList 刷新字段(Field)到所有记录 */
    Record_NodeList_Flush_Field_To_All_Rec(Record_Head);
}

/* Record NodeList 按索引更新字符串(String)值 */
void Record_NodeList_Update_StrVal_By_Idx(struct Record_Node* Record_Head, int RecIdx, int FldIdx, char* Value) {

    if (Record_Head->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Record Yet, Update Decimal Failed.\n");
    } else {
        struct Record_Node* Mov_Record = Record_Head;
        /* ****************************************** */
        while (Mov_Record->Next != NULL) {
            Mov_Record = Mov_Record->Next;
            if (Mov_Record->Idx == RecIdx) break;
        }
        /* ****************************************** */
        struct Field_Node* Mov_Field = Mov_Record->Field;
        /* ****************************************** */
        while (Mov_Field->Next != NULL) {
            Mov_Field = Mov_Field->Next;
            if (Mov_Field->Idx == FldIdx) break;
        }
        /* ****************************************** */
        strcpy(Mov_Field->Type, "String");
        strcpy(Mov_Field->StrVal, Value);
    }
}

/* Record NodeList 按索引更新小数(Decimal)值 */
void Record_NodeList_Update_DecVal_By_Idx(struct Record_Node* Record_Head, int RecIdx, int FldIdx, double Value) {

    if (Record_Head->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Record Yet, Update Decimal Failed.\n");
    } else {
        struct Record_Node* Mov_Record = Record_Head;
        /* ****************************************** */
        while (Mov_Record->Next != NULL) {
            Mov_Record = Mov_Record->Next;
            if (Mov_Record->Idx == RecIdx) break;
        }
        /* ****************************************** */
        struct Field_Node* Mov_Field = Mov_Record->Field;
        /* ****************************************** */
        while (Mov_Field->Next != NULL) {
            Mov_Field = Mov_Field->Next;
            if (Mov_Field->Idx == FldIdx) break;
        }
        /* ****************************************** */
        strcpy(Mov_Field->Type, "Decimal");
        Mov_Field->DecVal = Value;
    }
}

/* Record NodeList 按字段名称更新字符串(String)值 */
void Record_NodeList_Update_StrVal_By_FldName(struct Record_Node* Record_Head, int RecIdx, char* FldName, char* Value) {

    /* Calling Other Function: Record NodeList 获取字段(Field)索引(Index) - 通过字段名获取 */
    int Field_Index = Record_NodeList_Get_FldIdx_By_FldName(Record_Head, FldName);
    /* ********************************************** */
    if (Record_Head->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Record Yet, Update Decimal Failed.\n");
    } else {
        struct Record_Node* Mov_Record = Record_Head;
        /* ****************************************** */
        while (Mov_Record->Next != NULL) {
            Mov_Record = Mov_Record->Next;
            if (Mov_Record->Idx == RecIdx) break;
        }
        /* ****************************************** */
        struct Field_Node* Mov_Field = Mov_Record->Field;
        /* ****************************************** */
        while (Mov_Field->Next != NULL) {
            Mov_Field = Mov_Field->Next;
            if (Mov_Field->Idx == Field_Index) break;
        }
        /* ****************************************** */
        strcpy(Mov_Field->Type, "String");
        strcpy(Mov_Field->StrVal, Value);
    }
}

/* Record NodeList 按字段名称更新小数(Decimal)值 */
void Record_NodeList_Update_DecVal_By_FldName(struct Record_Node* Record_Head, int RecIdx, char* FldName, double Value) {

    /* Calling Other Function: Record NodeList 获取字段(Field)索引(Index) - 通过字段名获取 */
    int Field_Index = Record_NodeList_Get_FldIdx_By_FldName(Record_Head, FldName);
    /* ********************************************** */
    if (Record_Head->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Record Yet, Update Decimal Failed.\n");
    } else {
        struct Record_Node* Mov_Record = Record_Head;
        /* ****************************************** */
        while (Mov_Record->Next != NULL) {
            Mov_Record = Mov_Record->Next;
            if (Mov_Record->Idx == RecIdx) break;
        }
        /* ****************************************** */
        struct Field_Node* Mov_Field = Mov_Record->Field;
        /* ****************************************** */
        while (Mov_Field->Next != NULL) {
            Mov_Field = Mov_Field->Next;
            if (Mov_Field->Idx == Field_Index) break;
        }
        /* ****************************************** */
        strcpy(Mov_Field->Type, "Decimal");
        Mov_Field->DecVal = Value;
    }
}

/* Record NodeList 查找记录Decimal值 - 通过字段名查找 */
double Record_NodeList_Find_DecVal_By_FldName(struct Record_Node* Record_Head, int RecIdx, char* FldName) {

    /* Calling Other Function: Record NodeList 获取字段(Field)索引(Index) - 通过字段名获取 */
    int Field_Index = Record_NodeList_Get_FldIdx_By_FldName(Record_Head, FldName);
    /* ********************************************** */
    if (Record_Head->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Record Yet, Find Decimal Failed.\n");
        return 0.0;
    } else {
        struct Record_Node* Mov_Record = Record_Head;
        /* ****************************************** */
        while (Mov_Record->Next != NULL) {
            Mov_Record = Mov_Record->Next;
            if (Mov_Record->Idx == RecIdx) break;
        }
        /* ****************************************** */
        if (Mov_Record == NULL) return 0.0;
        /* ****************************************** */
        struct Field_Node* Mov_Field = Mov_Record->Field;
        /* ****************************************** */
        while (Mov_Field->Next != NULL) {
            Mov_Field = Mov_Field->Next;
            if (Mov_Field->Idx == Field_Index) break;
        }
        /* ****************************************** */
        if (Mov_Field == NULL) return 0.0;
        /* ****************************************** */
        double Res_DecVal = Mov_Field->DecVal;
        /* ****************************************** */
        return Res_DecVal;
    }
}

/* Record NodeList 按索引删除(Delete)记录(Record) */
void Record_NodeList_Delete_Record_By_Idx(struct Record_Node* Record_Head, int RecIdx) {

    int Skip = 0;
    /* ********************************************** */
    if (Record_Head->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Record Yet, Delete Record Failed.\n");
    } else {
        struct Record_Node *Mov_Record = Record_Head;
        /* ****************************************** */
        while (Mov_Record->Next != NULL) {Mov_Record = Mov_Record->Next; if (Mov_Record->Idx == RecIdx) break;}
        /* ****************************************** */
        if (Mov_Record != NULL) {
            struct Record_Node *Prev_Node = Mov_Record->Prev; /* 待删除节点的前1个节点 */
            struct Record_Node *After_Node = Mov_Record->Next; /* 待删除节点的后1个节点 */
            /* ************************************** */
            if (After_Node == NULL) Prev_Node->Next = NULL; else Prev_Node->Next = After_Node;
            if (After_Node == NULL) Skip = Skip + 1; else After_Node->Prev = Prev_Node;
            /* ************************************** */
            free(Mov_Record);
        }
    }
}

/* Record NodeList 重置记录(Record)索引(Index) */
void Record_NodeList_Reset_Record_Idx(struct Record_Node* Record_Head) {

    int Record_Index = 0;
    /* ********************************************** */
    struct Record_Node* Mov_Record = Record_Head;
    /* ********************************************** */
    while (Mov_Record->Next != NULL) {
        Mov_Record = Mov_Record->Next;
        /* ****************************************** */
        if (Mov_Record != NULL) Mov_Record->Idx = Record_Index;
        /* ****************************************** */
        if (Mov_Record != NULL) Record_Index++;
    }
}

/* Record NodeList 冒泡排序(Bubble Sort Asc) - 按字段名 */
void Record_NodeList_Bubble_Sort_Asc_By_FldName(struct Record_Node* Record_Head, char* FldName) {

    if (Record_Head->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Record Yet, Bubble Sort ASC By FldName Failed.\n");
    } else {
        /* Calling Other Function: Record NodeList 获取记录(Record)行数 */
        int Rows_Number = Record_NodeList_Get_Rows_Number(Record_Head);
        int Cycle_Number = Rows_Number;
        /* ****************************************** */
        for (int i = 1; i <= Rows_Number; i++) {
            struct Record_Node* Node_A = Record_Head;
            struct Record_Node* Node_B = Record_Head->Next;
            /* ************************************** */
            int j = 1;
            while (Node_B->Next != NULL && j <= Cycle_Number) {
                Node_A = Node_A->Next;
                Node_B = Node_B->Next;
                /* ********************************** */
                if (Node_B == NULL) break;
                /* ********************************** */
                double Value_A = Field_NodeList_Find_DecVal_By_FldName(Node_A->Field, FldName);
                double Value_B = Field_NodeList_Find_DecVal_By_FldName(Node_B->Field, FldName);
                /* ********************************** */
                if (Value_A > Value_B) { /* 如果 A 比 B 大, 则将 A 后移, 并将 B 前移 */
                    struct Record_Node* Left_Breakpoint = Node_A->Prev;
                    struct Record_Node* Right_Breakpoint = Node_B->Next;
                    struct Record_Node* Node_X = Node_A;
                    /* ****************************** */
                    Left_Breakpoint->Next = Node_B;
                    Node_B->Prev = Left_Breakpoint;
                    Node_B->Next = Node_X;
                    /* ****************************** */
                    if (Right_Breakpoint != NULL) Right_Breakpoint->Prev = Node_X;
                    Node_X->Next = Right_Breakpoint;
                    Node_X->Prev = Node_B;
                    /* ****************************** */
                    Node_A = Node_B; /* 交换位置 A 变 B */
                    Node_B = Node_X; /* 交换位置 B 变 X(A) */
                }
                j++;
            }
            Cycle_Number--;
        }
    }
}

/* Record NodeList 冒泡排序(Bubble Sort Desc) - 按字段名 */
void Record_NodeList_Bubble_Sort_Desc_By_FldName(struct Record_Node* Record_Head, char* FldName) {

    if (Record_Head->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Record Yet, Bubble Sort DESC By FldName Failed.\n");
    } else {
        /* Calling Other Function: Record NodeList 获取记录(Record)行数 */
        int Rows_Number = Record_NodeList_Get_Rows_Number(Record_Head);
        int Cycle_Number = Rows_Number;
        /* ****************************************** */
        for (int i = 1; i <= Rows_Number; i++) {
            struct Record_Node* Node_A = Record_Head;
            struct Record_Node* Node_B = Record_Head->Next;
            /* ************************************** */
            int j = 1;
            while (Node_B->Next != NULL && j <= Cycle_Number) {
                Node_A = Node_A->Next;
                Node_B = Node_B->Next;
                /* ********************************** */
                if (Node_B == NULL) break;
                /* ********************************** */
                double Value_A = Field_NodeList_Find_DecVal_By_FldName(Node_A->Field, FldName);
                double Value_B = Field_NodeList_Find_DecVal_By_FldName(Node_B->Field, FldName);
                /* ********************************** */
                if (Value_A < Value_B) { /* 如果 A 比 B 小, 则将 A 后移, 并将 B 前移 */
                    struct Record_Node* Left_Breakpoint = Node_A->Prev;
                    struct Record_Node* Right_Breakpoint = Node_B->Next;
                    struct Record_Node* Node_X = Node_A;
                    /* ****************************** */
                    Left_Breakpoint->Next = Node_B;
                    Node_B->Prev = Left_Breakpoint;
                    Node_B->Next = Node_X;
                    /* ****************************** */
                    if (Right_Breakpoint != NULL) Right_Breakpoint->Prev = Node_X;
                    Node_X->Next = Right_Breakpoint;
                    Node_X->Prev = Node_B;
                    /* ****************************** */
                    Node_A = Node_B; /* 交换位置 A 变 B */
                    Node_B = Node_X; /* 交换位置 B 变 X(A) */
                }
                j++;
            }
            Cycle_Number--;
        }
    }
}

/* Record NodeList 从二维指针数组载入字段值(FldVal) */
void Record_NodeList_Load_FldVal_From_TwoDimPtrArr(struct Record_Node* Record_Head, char* FldName, char*** TwoDimPtrArr, int ArrCol) {

    long long ArrRowsNum = Char_TwoDimPtrArray_Get_RowsNum(TwoDimPtrArr);
    /* ********************************************** */
    for (long long i = 0; i < ArrRowsNum; i++) {
        /* Calling Other Function: Record NodeList 判断记录(Record)存在某个索引(Index) */
        if (Record_NodeList_Judge_Exists_Idx(Record_Head, (int)i) == 0)
            /* Calling Other Function: 记录末尾添加记录(Record) - 指定索引(Index) */
            Record_NodeList_Append_Record_Alloc_Idx(Record_Head, (int)i);
        /* Calling Other Function: 按字段名称更新字符串(String)值 */
        Record_NodeList_Update_StrVal_By_FldName(Record_Head, (int)i, FldName, TwoDimPtrArr[i][ArrCol]);
    }
}

/* Record NodeList 字段(Field)值类型转换 */
void Record_NodeList_FldVal_Type_Convert(struct Record_Node* Record_Head, char* FldName, char* Type) {

    /* Calling Other Function: Record NodeList 获取字段(Field)索引(Index) - 通过字段名获取 */
    int Field_Index = Record_NodeList_Get_FldIdx_By_FldName(Record_Head, FldName);
    /* ********************************************** */
    if (Record_Head->Field->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Field Yet, FldVal Type Convert Failed.\n");
    } else {
        struct Record_Node* Mov_Record = Record_Head;
        while (Mov_Record->Next != NULL) {
            Mov_Record = Mov_Record->Next;
            /* ************************************** */
            if (Mov_Record == NULL) break;
            /* ************************************** */
            struct Field_Node* Mov_Field = Mov_Record->Field;
            while (Mov_Field->Next != NULL) {Mov_Field = Mov_Field->Next; if (Mov_Field->Idx == Field_Index) break;}
            /* ************************************** */
            /*
            * double strtod(const char *str, char **endptr)
            *
            * 如果 endptr 不为空, 则指向转换中最后一个字符后的字符的指针会存储在 endptr 引用的位置.
            *
            * char str[30] = "20.30300 This is test";
            * char *ptr;
            * ret = strtod(str, &ptr);
            *
            * ret: 数字(double)部分.
            * ptr: 字符串(String)部分.
            */
            if (Mov_Field != NULL && strcmp(Type, "Decimal") == 0) Mov_Field->DecVal = strtod(Mov_Field->StrVal, NULL);
            if (Mov_Field != NULL && strcmp(Type, "Integer") == 0) Mov_Field->IntVal = atoi(Mov_Field->StrVal);
        }
    }
}

/* Record NodeList 记录(Record)格式化输出 */
void Record_NodeList_Record_Format_Print(struct Record_Node* Record_Head) {

    /* 条件判断 : 如果数据记录链表字段指向的 Next 节点为 NULL */
    if (Record_Head->Field->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Field Yet, Format Print Failed.\n");
    } else {
        /* Calling Other Function: Field NodeList 字段(Field)名称格式化输出 */
        Field_NodeList_FldName_Format_Print(Record_Head->Field);
        /* ****************************************** */
        struct Record_Node* Mov_Record = Record_Head;
        while (Mov_Record->Next != NULL) {
            Mov_Record = Mov_Record->Next;
            /* ************************************** */
            /* Calling Other Function: Field NodeList 字段(Field)值格式化输出 */
            if (Mov_Record != NULL) Field_NodeList_FldVal_Format_Print(Mov_Record->Field);
        }
    }
}

/* Record NodeList 记录(Record)格式化输出为CSV */
void Record_NodeList_Record_Format_Print_As_Csv(struct Record_Node* Record_Head, char* Out_Path) {

    /* 条件判断 : 如果数据记录链表字段指向的 Next 节点为 NULL */
    if (Record_Head->Field->Next == NULL) {
        printf("Record NodeList Notice : Record NodeList Doesn't Have Any Field Yet, Format Print as CSV Failed.\n");
    } else {
        /* Calling Other Function: Field NodeList 字段(Field)名称格式化输出为CSV */
        Field_NodeList_FldName_Format_Print_As_Csv(Record_Head->Field, Out_Path);
        /* ****************************************** */
        struct Record_Node* Mov_Record = Record_Head;
        while (Mov_Record->Next != NULL) {
            Mov_Record = Mov_Record->Next;
            /* ************************************** */
            /* Calling Other Function: Field NodeList 字段(Field)值格式化输出为CSV */
            if (Mov_Record != NULL) Field_NodeList_FldVal_Format_Print_As_Csv(Mov_Record->Field, Out_Path);
        }
    }
}

/* Record NodeList 复制所有记录(Record) */
struct Record_Node* Record_NodeList_Copy_All_Record(struct Record_Node* Src_Record) {

    struct Record_Node* Dst_Record = Record_NodeList_Node_Init();
    /* ********************************************** */
    /* Step 1: Add Fields For Destination Records Based on The Fields in The Source Record */
    struct Field_Node* Mov_SrcRecField = Src_Record->Field;
    /* ********************************************** */
    while (Mov_SrcRecField->Next != NULL) {
        Mov_SrcRecField = Mov_SrcRecField->Next;
        /* ****************************************** */
        if (Mov_SrcRecField == NULL) break;
        /* Field NodeList 字段末尾添加字段(Field) - 指定索引(Index) */
        Field_NodeList_Append_Field_Alloc_Idx(Dst_Record->Field, Mov_SrcRecField->Name, Mov_SrcRecField->Idx);
    }
    /* ********************************************** */
    /* Step 2: Add Nodes For Destination Records Based on The Number of Rows in The Source Record */
    struct Record_Node* Mov_SrcRec = Src_Record;
    /* ********************************************** */
    while (Mov_SrcRec->Next != NULL) {
        Mov_SrcRec = Mov_SrcRec->Next;
        /* ****************************************** */
        if (Mov_SrcRec == NULL) break;
        /* Calling Other Function: 记录末尾添加记录(Record) - 指定索引(Index) */
        Record_NodeList_Append_Record_Alloc_Idx(Dst_Record, Mov_SrcRec->Idx);
    }
    /* ********************************************** */
    /* Step 3: Add Values For Destination Records Based on The Values in The Source Record */
    Mov_SrcRec = Src_Record; /* 链表指针重新赋值 */
    struct Record_Node* Mov_DstRec = Dst_Record;
    /* ********************************************** */
    while (Mov_SrcRec->Next != NULL && Mov_DstRec->Next != NULL) {
        Mov_SrcRec = Mov_SrcRec->Next;
        Mov_DstRec = Mov_DstRec->Next;
        /* ****************************************** */
        if (Mov_SrcRec == NULL || Mov_DstRec == NULL) break;
        /* ****************************************** */
        Mov_SrcRecField = Mov_SrcRec->Field; /* 链表指针重新赋值 */
        struct Field_Node* Mov_DstRecField = Mov_DstRec->Field;
        /* ****************************************** */
        while (Mov_SrcRecField->Next != NULL && Mov_DstRecField->Next != NULL) {
            Mov_SrcRecField = Mov_SrcRecField->Next;
            Mov_DstRecField = Mov_DstRecField->Next;
            /* ****************************************** */
            if (Mov_SrcRecField == NULL || Mov_DstRecField == NULL) break;
            /* ************************************** */
            strcpy(Mov_DstRecField->Type, Mov_SrcRecField->Type);
            strcpy(Mov_DstRecField->StrVal, Mov_SrcRecField->StrVal);
            Mov_DstRecField->IntVal = Mov_SrcRecField->IntVal;
            Mov_DstRecField->DecVal = Mov_SrcRecField->DecVal;
        }
    }
    /* ********************************************** */
    return Dst_Record;
}

/* Record NodeList 创建系列(Series)记录 */
struct Record_Node* Record_NodeList_Create_Series(char* FldName, int RowsNum) {

    struct Record_Node* Series_Record_Head = Record_NodeList_Node_Init();
    /* ********************************************** */
    /* Calling Other Function: Field NodeList 字段末尾添加字段(Field) */
    Field_NodeList_Append_Field(Series_Record_Head->Field, FldName);
    /* ********************************************** */
    /* Calling Other Function: 记录末尾添加记录(Record) */
    for (int i = 0; i < RowsNum; i++) Record_NodeList_Append_Record(Series_Record_Head);
    /* ********************************************** */
    return Series_Record_Head;
}

/* Record NodeList 通过字段(Field)名称提取系列(Series)记录 */
struct Record_Node* Record_NodeList_Extract_Series_By_FldName(struct Record_Node* Record_Head, char* FldName) {

    /* Calling Other Function */
    int Field_Index = Record_NodeList_Get_FldIdx_By_FldName(Record_Head, FldName); /* 获取字段(Field)索引(Index) - 通过字段名获取 */
    int Series_Num = Record_NodeList_Get_Rows_Number(Record_Head); /* 获取记录(Record)行数 */
    struct Record_Node* Ext_Series = Record_NodeList_Create_Series(FldName, Series_Num); /* 创建系列(Series)记录 */
    /* ********************************************** */
    struct Record_Node* Mov_Series = Ext_Series;
    struct Record_Node* Mov_Record = Record_Head;
    /* ********************************************** */
    while (Mov_Record->Next != NULL && Mov_Series->Next != NULL) {
        Mov_Record = Mov_Record->Next;
        Mov_Series = Mov_Series->Next;
        /* ****************************************** */
        if (Mov_Record != NULL && Mov_Series != NULL) {
            struct Field_Node* Src_Field = Mov_Record->Field;
            struct Field_Node* Dst_Field = Mov_Series->Field;
            /* ************************************** */
            while (Src_Field->Next != NULL) {
                Src_Field = Src_Field->Next;
                /* ********************************** */
                if (Src_Field != NULL && Src_Field->Idx == Field_Index) {
                    Dst_Field->Next->Idx = Src_Field->Idx;
                    strcpy(Dst_Field->Next->Type, Src_Field->Type);
                    strcpy(Dst_Field->Next->StrVal, Src_Field->StrVal);
                    Dst_Field->Next->IntVal = Src_Field->IntVal;
                    Dst_Field->Next->DecVal = Src_Field->DecVal;
                } /* ******** Judgment 2 End ******** */
            } /* ************ Loop 2 End ************ */
        } /* ************ Judgment 1 End ************ */
    } /* **************** Loop 1 End **************** */
    /* ********************************************** */
    return Ext_Series;
}

/* Record NodeList 左连接(Left Join) - 按索引(Index) */
struct Record_Node* Record_NodeList_Left_Join_On_RecIdx(struct Record_Node* Left_Rec, struct Record_Node* Right_Rec, char* Suffixes) {

    if (Left_Rec->Next == NULL || Right_Rec->Next == NULL) {
        printf("Record NodeList Notice : Left or Right Record NodeList is Empty, Left Join Failed.\n");
        /* ****************************************** */
        return NULL;
    } else {
        /* Calling Other Function: Record NodeList 复制所有记录(Record) */
        struct Record_Node* Copy_Left_Rec = Record_NodeList_Copy_All_Record(Left_Rec);
        /* ****************************************** */
        /* Step 1 : 将右(Right)的头结点中的字段按名称添加到左(Left)的头节点 */
        struct Field_Node *Mov_Right_Field = Right_Rec->Field;
        /* ****************************************** */
        while (Mov_Right_Field->Next != NULL) {
            Mov_Right_Field = Mov_Right_Field->Next;
            /* ************************************** */
            char Field_Name[32] = {'\0'}; /* 重组字段名以避免字段名重复 */
            if (Suffixes != NULL) sprintf(Field_Name, "%s%s", Mov_Right_Field->Name, Suffixes);
            /* ************************************** */
            /* Calling Other Function: Field NodeList 字段末尾添加字段(Field) */
            Field_NodeList_Append_Field(Copy_Left_Rec->Field, Field_Name);
        }
        /* ****************************************** */
        /* Calling Other Function: Record NodeList 刷新字段(Field)到所有记录 */
        Record_NodeList_Flush_Field_To_All_Rec(Copy_Left_Rec);
        /* ****************************************** */
        struct Record_Node* Mov_Left = Mov_Left = Copy_Left_Rec;
        /* ****************************************** */
        while (Mov_Left->Next != NULL) {
            Mov_Left = Mov_Left->Next;
            /* ************************************** */
            if (Mov_Left == NULL) break;
            /* ************************************** */
            /* Step 2 : 查找右(Right)字段与左(Left)字段Join参照值对应的Record节点 */
            struct Record_Node* Mov_Right = Right_Rec;
            /* ************************************** */
            while (Mov_Right->Next != NULL) {
                Mov_Right = Mov_Right->Next;
                /* ********************************** */
                if (Mov_Left->Idx == Mov_Right->Idx) break;
            }
            /* ************************************** */
            if (Mov_Right == NULL) continue;
            /* ************************************** */
            /* Step 3 : 将(右)Right字段中的值Copy到(左)Left字段中 */
            struct Field_Node* Ergodic_Right_Field = Right_Rec->Field;
            /* ************************************** */
            while (Ergodic_Right_Field->Next != NULL) {
                Ergodic_Right_Field = Ergodic_Right_Field->Next;
                /* ********************************** */
                if (Ergodic_Right_Field == NULL) break;
                /* ********************************** */
                char Field_Name[32] = {'\0'}; /* 重组字段名以按照重组的字段名Copy字段值 */
                if (Suffixes != NULL) sprintf(Field_Name, "%s%s", Ergodic_Right_Field->Name, Suffixes);
                /* ********************************** */
                /* Calling Other Function: Field NodeList 复制字段(Field)值 - 通过字段名复制 */
                Field_NodeList_Copy_FldVals_By_FldName(Mov_Left->Field, Field_Name, Mov_Right->Field, Ergodic_Right_Field->Name);
            }
        }
        /* ****************************************** */
        return Copy_Left_Rec;
    }
}

/* Record NodeList 左连接(Left Join) - 按字段名 */
struct Record_Node* Record_NodeList_Left_Join_On_FldName(struct Record_Node* Left_Rec, struct Record_Node* Right_Rec, char* On_FldName) {

    if (Left_Rec->Next == NULL || Right_Rec->Next == NULL) {
        printf("Record NodeList Notice : Left or Right Record NodeList is Empty, Left Join Failed.\n");
        /* ****************************************** */
        return NULL;
    } else {
        /* Calling Other Function: Record NodeList 复制所有记录(Record) */
        struct Record_Node* Copy_Left_Rec = Record_NodeList_Copy_All_Record(Left_Rec);
        /* ****************************************** */
        /* Step 1 : 将右(Right)的头结点中的字段按名称添加到左(Left)的头节点 */
        struct Field_Node *Mov_Right_Field = Right_Rec->Field;
        /* ****************************************** */
        while (Mov_Right_Field->Next != NULL) {
            Mov_Right_Field = Mov_Right_Field->Next;
            /* ************************************** */
            if (strcmp(Mov_Right_Field->Name, On_FldName) != 0) /* 跳过Join参照字段 */
                /* Calling Other Function: Field NodeList 字段末尾添加字段(Field) */
                Field_NodeList_Append_Field(Copy_Left_Rec->Field, Mov_Right_Field->Name);
        }
        /* ****************************************** */
        /* Calling Other Function: Record NodeList 刷新字段(Field)到所有记录 */
        Record_NodeList_Flush_Field_To_All_Rec(Copy_Left_Rec);
        /* ****************************************** */
        struct Record_Node* Mov_Left = Mov_Left = Copy_Left_Rec;
        /* ****************************************** */
        while (Mov_Left->Next != NULL) {
            Mov_Left = Mov_Left->Next;
            /* ************************************** */
            if (Mov_Left == NULL) break;
            /* ************************************** */
            /* Calling Other Function: Field NodeList 查找字段String值 - 通过字段名查找 */
            char* Left_Refer = Field_NodeList_Find_StrVal_By_FldName(Mov_Left->Field, On_FldName);
            /* ************************************** */
            if (Left_Refer == NULL) break;
            /* ************************************** */
            /* Step 2 : 查找右(Right)字段与左(Left)字段Join参照值对应的Record节点 */
            struct Record_Node* Mov_Right = Right_Rec;
            /* ************************************** */
            while (Mov_Right->Next != NULL) {
                Mov_Right = Mov_Right->Next;
                /* ********************************** */
                /* Calling Other Function: Field NodeList 查找字段String值 - 通过字段名查找 */
                char* Right_Refer = Field_NodeList_Find_StrVal_By_FldName(Mov_Right->Field, On_FldName);
                /* ********************************** */
                if (strcmp(Left_Refer, Right_Refer) == 0) {free(Left_Refer); free(Right_Refer); break;}
            }
            /* ************************************** */
            if (Mov_Right == NULL) continue;
            /* ************************************** */
            /* Step 3 : 将(右)Right字段中的值Copy到(左)Left字段中 */
            struct Field_Node* Ergodic_Right_Field = Right_Rec->Field;
            /* ************************************** */
            while (Ergodic_Right_Field->Next != NULL) {
                Ergodic_Right_Field = Ergodic_Right_Field->Next;
                /* ********************************** */
                if (Ergodic_Right_Field == NULL) break;
                /* ********************************** */
                if (strcmp(Ergodic_Right_Field->Name, On_FldName) != 0) /* 跳过Join参照字段 */
                    /* Calling Other Function: Field NodeList 复制字段(Field)值 - 通过字段名复制 */
                    Field_NodeList_Copy_FldVals_By_FldName(Mov_Left->Field, Ergodic_Right_Field->Name, Mov_Right->Field, Ergodic_Right_Field->Name);
            }
        }
        /* ****************************************** */
        return Copy_Left_Rec;
    }
}
